package _06继承概述;

public class Demo {
    public static void main(String[] args) {
        //创建子类对象
        Student student = new Student();
        //调用父类的getter和setter方法
        student.setAge(18);
        student.setName("张三");
        //调用子类特有的方法
        student.study();
        //子类可以调用父类方法
        student.eat();

        Teacher teacher = new Teacher();
        teacher.setName("李四");
        teacher.setAge(33);
        teacher.eat();
        teacher.teach();
    }
}
